using System;
using System.Text;
using System.Collections.Generic;
using iBeauty.BusinessObjects;
using iBeauty.DAL;

namespace iBeauty.BLL
{
	public class SearchSettingBLL
	{
		private SearchSettingDAO _SearchSettingDAO;

		public SearchSettingDAO SearchSettingDAO
		{
			get { return _SearchSettingDAO; }
			set { _SearchSettingDAO = value; }
		}

		public SearchSettingBLL()
		{
			SearchSettingDAO = new SearchSettingDAO();
		}
		public List<SearchSetting> GetSearchSettings()
		{
			try
			{
				return SearchSettingDAO.GetSearchSettings();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public SearchSetting GetSearchSetting(string ID)
		{
			try
			{
				return SearchSettingDAO.GetSearchSetting(ID);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddSearchSetting(SearchSetting oSearchSetting)
		{
			try
			{
				return SearchSettingDAO.AddSearchSetting(oSearchSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int AddSearchSetting(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,int? SearchObject,string SearchCondition,string IsAddResult,string IsOnResult,int? AccountId)
		{
			try
			{
				return SearchSettingDAO.AddSearchSetting(ID,CreateDate,ModifiedDate,TimeStamp,SearchObject,SearchCondition,IsAddResult,IsOnResult,AccountId);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateSearchSetting(SearchSetting oSearchSetting)
		{
			try
			{
				return SearchSettingDAO.UpdateSearchSetting(oSearchSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateSearchSetting(string ID,DateTime? CreateDate,DateTime? ModifiedDate,DateTime? TimeStamp,int? SearchObject,string SearchCondition,string IsAddResult,string IsOnResult,int? AccountId)
		{
			try
			{
				return SearchSettingDAO.UpdateSearchSetting(ID,CreateDate,ModifiedDate,TimeStamp,SearchObject,SearchCondition,IsAddResult,IsOnResult,AccountId);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveSearchSetting(SearchSetting oSearchSetting)
		{
			try
			{
				return SearchSettingDAO.RemoveSearchSetting(oSearchSetting);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveSearchSetting(string ID)
		{
			try
			{
				return SearchSettingDAO.RemoveSearchSetting(ID);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<SearchSetting> DeserializeSearchSettings(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<SearchSetting>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeSearchSettings(string Path, List<SearchSetting> SearchSettings)
		{
			try
			{
				GenericXmlSerializer<List<SearchSetting>>.Serialize(SearchSettings, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
